package com.silent.week.common.jvm;


public class TestEqualsHashCode {
    private String name;

    TestEqualsHashCode(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof TestEqualsHashCode)) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        TestEqualsHashCode other = (TestEqualsHashCode) obj;
        return (name == null && null == other.name)
                || (null != name && name.equals(other.name));
    }

    @Override
    public int hashCode() {
        return (int) (Math.random() * 2021);
    }

    @Override
    public String toString() {
        return "TestEqualsHashCode{name=" + name + "}";
    }
}


